﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdminManagers.aspx.cs"
         Inherits="TaskWebApplicationUI.AdminManagers" Theme="TaskTheme" ValidateRequest="false"
         MasterPageFile="WebTasksMaster.Master" %>

<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls"
             TagPrefix="pp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MasterPagePlaceHolder" runat="Server">
    <pp:objectcontainerdatasource id="ObjectContainerDataSource1" runat="server" 
                                  ondeleted="ObjectContainerDataSource1_Deleted" />
    <pp:objectcontainerdatasource id="ObjectContainerDataSource2" runat="server" 
                                  ondeleted="ObjectContainerDataSource2_Deleted" />
    <p style="text-align: center;">
        <asp:Label ID="Department" SkinID="Department" runat="server" Text="ФИО пользователя"></asp:Label>
    </p>
    <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
    <br />
    <table class="spisok">
        <tr>
            <td>
                <asp:DropDownList ID="AccountDDL" runat="server" DataTextField="FullName" DataValueField="UID"
                                  CssClass="bodyt">
                </asp:DropDownList>
            </td>
            <td>
                <asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkButton3_Click" 
                                CssClass="bodyt">В руководители</asp:LinkButton>
            </td>
            <td>
                <asp:LinkButton ID="LinkButton4" runat="server" OnClick="LinkButton4_Click" 
                                CssClass="bodyt">В подчиненные</asp:LinkButton>
            </td>
        </tr>
    </table>
    <hr />
    <asp:Label ID="Label2" runat="server" Text="Руководители" CssClass="details"></asp:Label>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectContainerDataSource1"
                  BorderWidth="1px" CssClass="grid-view" GridLines="None" CellPadding="4" BorderStyle="None"
                  AllowSorting="True" DataKeyNames="UID">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="UID" runat="server" Text='<%#Bind("UID")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <%--            <asp:TemplateField HeaderText="Имя уч. записи">
                <ItemTemplate>
                    <asp:Label ID="Login" runat="server" Text='<%# Bind("Login") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            --%>
            <asp:TemplateField HeaderText="ФИО" SortExpression="FullName">
                <ItemTemplate>
                    <asp:Label ID="FullName" runat="server" Text='<%#Bind("FullName")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Уволен">
                <ItemTemplate>
                    <asp:CheckBox ID="Fired" Enabled="false" runat="server" Checked='<%#Bind("Fired")%>'>
                    </asp:CheckBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="Button2" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="Удалить" OnClientClick="return confirm('Удалить ?');" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle HorizontalAlign="Right" />
        <RowStyle HorizontalAlign="Right" />
    </asp:GridView>
    <hr />
    <asp:Label ID="Label3" runat="server" Text="Подчиненные" CssClass="Details"></asp:Label>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectContainerDataSource2"
                  BorderWidth="1px" CssClass="grid-view" GridLines="None" CellPadding="4" BorderStyle="None"
                  AllowSorting="True" DataKeyNames="UID">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="UID" runat="server" Text='<%#Bind("UID")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <%--            <asp:TemplateField HeaderText="Имя уч. записи">
                <ItemTemplate>
                    <asp:Label ID="Login" runat="server" Text='<%# Bind("Login") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            --%>
            <asp:TemplateField HeaderText="ФИО" SortExpression="FullName">
                <ItemTemplate>
                    <asp:Label ID="FullName" runat="server" Text='<%#Bind("FullName")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Уволен">
                <ItemTemplate>
                    <asp:CheckBox ID="Fired" Enabled="false" runat="server" Checked='<%#Bind("Fired")%>'>
                    </asp:CheckBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="Button2" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="Удалить" OnClientClick="return confirm('Удалить ?');" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle HorizontalAlign="Right" />
        <RowStyle HorizontalAlign="Right" />
    </asp:GridView>
</asp:Content>